//
//  FoodsTableViewCell.swift
//  beegin2
//
//  Created by zsy on 16/3/12.
//  Copyright © 2016年 kszz. All rights reserved.
//

import UIKit

class FoodsTableViewCell: UITableViewCell {

    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override func layoutSubviews() {
    
        super.layoutSubviews()
        
        if let foodImageView = self.imageView{
        
            let imageCenter = foodImageView.center
            foodImageView.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
            foodImageView.center = imageCenter
            foodImageView.layer.cornerRadius = foodImageView.frame.width / 2
        }
        
        if let label = self.viewWithTag(11) as? UILabel{
        
            label.baselineAdjustment = .AlignBaselines
            label.center = CGPoint(x: self.frame.width - 60, y: self.frame.height / 2)
            label.font = UIFont(name: "System", size: 14 )
           // print(label.font,label.adjustsFontSizeToFitWidth)
        }
        
        if let imageView = self.viewWithTag(12) as? UIImageView{
            imageView.contentMode = .Center
            imageView.center = CGPoint(x: self.frame.width - 60, y: self.frame.height / 2)

        }
    }
}
